Replace fabricated ABI proofs with machine-checked Idris2 proofs#24
Merged
Conversation
The three "Safety Proofs" in src/abi/Foreign.idr (stabilityBounded,
positionalDeterministic, paradoxMonotonic) were not proofs: each fabricated
its evidence with cast ()/cast Refl over an IO action. Replace them with
genuine, self-contained Idris2 modules, machine-checked under Idris 2 v0.8.0
(no believe_me / assert_total / cast / postulate):
- Stability.idr : stability score is bounded in [0,100] (clamp model of
compiler/src/Types.res calculateStability).
- Positional.idr : positional-operator behaviour is deterministic over the
pure model of the Zig FFI (a genuine Refl, not IO cast Refl).
- Paradox.idr : the two threshold-gated factors are monotone; the blanket
"paradox detection monotonic" claim is RETRACTED -- proving
it honestly surfaced that scope_leakage is prime-gated and
therefore non-monotone (line 7 prime, line 8 not).
Foreign.idr is reduced to an honest, self-contained ABI binding layer.
Add error-lang-abi.ipkg and verification/check-proofs.sh (idris2 --check all
four modules). Rewrite PROOF-NEEDS.md to record what is proved, what is
retracted, the toolchain, and open conformance obligations.
The language's satirical "100% production-ready / formally verified"
self-presentation in README/WHITEPAPER is intentional and left intact; this
change only makes the underlying proof artifacts real and honest.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
hyperpolymath
marked this pull request as ready for review
June 23, 2026 16:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The three "Safety Proofs" in
src/abi/Foreign.idr(stabilityBounded,positionalDeterministic,paradoxMonotonic) were not proofs — each fabricated its evidence withcast ()/cast Reflover anIOaction (e.g. calling an FFI function twice and coercingRefl : x = xonto the two distinct results). This PR replaces them with genuine, self-contained Idris2 modules that are machine-checked under Idris 2 v0.8.0 — nobelieve_me/assert_total/cast/postulate.The proofs (all check ✅)
src/abi/Stability.idrsrc/abi/Positional.idrsrc/abi/Paradox.idrThe honest finding: monotonicity is false, not just unproven
Trying to prove "paradox detection is monotonic with complexity" honestly is what surfaced that it is false of the implementation:
error_lang_detect_paradoxes(ffi/zig/src/main.zig) gatesscope_leakageonisPrime(line_count), which is non-monotone — line 7 is prime → active, line 8 is composite → inactive, although 8 > 7.Paradox.idrproves the two threshold-gated factors that are monotone (superpositionMonotone,temporalMonotone) and retracts the blanket claim. Non-monotone scope leakage is intentional — it is the pedagogical point of the paradox — but the proof now says so out loud instead of hiding behindcast Refl.Also in this PR
Foreign.idrreduced to an honest, self-contained ABI binding layer (asserts no theorems).src/abi/error-lang-abi.ipkg+verification/check-proofs.shto reproduce the checks.PROOF-NEEDS.mdrewritten as an honest ledger: what is proved, what is retracted, the toolchain, and open conformance obligations (incl. that the Zigcolumn % 2and ReScript(line*31+column) mod 4positional rules disagree).Verification status — run, not assumed
src/abimodules check green.jsr.io) are blocked by this environment's network policy — runtime not executed.returnis not valid ReScript atVM.res:407; two-argumentdict<string, int>atTypes.res:233) — reported, not fixed in this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
Generated by Claude Code